package com.x.config;

import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;

/**
 * ClassName: SpringInit
 * Package: IntelliJ IDEA
 * Description:
 * Written by HanXu
 * Create 2024.09.15 15:48
 */
public class SpringInit extends AbstractAnnotationConfigDispatcherServletInitializer {

    //root ioc的配置类传入: service层与持久层
    @Override
    protected Class<?>[] getRootConfigClasses() {
        return new Class[]{ServiceJavaConfig.class, MapperJavaConfig.class, DataSourceConfig.class};
    }


    //Web ioc容器的配置类传入: controller层
    @Override
    protected Class<?>[] getServletConfigClasses() {
        return new Class[]{WebMvcJavaConfig.class};
    }

    //MVC中dispatcherServlet的拦截路径
    @Override
    protected String[] getServletMappings() {
        return new String[]{"/"};
    }
}
